﻿using System;
using System.Collections.Generic;
using System.Text;

namespace OrderingEntities
{
    partial class FoodOrders : RaisingStudio.Data.Common.IDataObjectProxy
    {
        #region IDataObjectProxy Members

        public Type GetPropertyType(string name)
        {
            switch (name)
            {                
                case "ID":
                   {
                       return typeof(int);
                   }
                case "TableNO":
                   {
                       return typeof(string);
                   }
                case "KindName":
                   {
                       return typeof(string);
                   }
                case "FoodName":
                   {
                       return typeof(string);
                   }
                case "Price":
                   {
                       return typeof(float);
                   }
                case "FoodCount":
                   {
                       return typeof(float);
                   }
                case "UserName":
                   {
                       return typeof(string);
                   }
                case "CreateTime":
                   {
                       return typeof(DateTime);
                   }
                case "Comment":
                   {
                       return typeof(string);
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectAccessor Members

        public object GetValue(object instance, string name)
        {
            FoodOrders _instance = instance as FoodOrders;
            switch (name)
            {                
                case "ID":
                   {
                       return _instance.ID;
                   }
                case "TableNO":
                   {
                       return _instance.TableNO;
                   }
                case "KindName":
                   {
                       return _instance.KindName;
                   }
                case "FoodName":
                   {
                       return _instance.FoodName;
                   }
                case "Price":
                   {
                       return _instance.Price;
                   }
                case "FoodCount":
                   {
                       return _instance.FoodCount;
                   }
                case "UserName":
                   {
                       return _instance.UserName;
                   }
                case "CreateTime":
                   {
                       return _instance.CreateTime;
                   }
                case "Comment":
                   {
                       return _instance.Comment;
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        public void SetValue(object instance, string name, object value)
        {
            FoodOrders _instance = instance as FoodOrders;
            switch (name)
            {                
                case "ID":
                    {
                        _instance.ID = (int)value;
                        return;
                    }
                case "TableNO":
                    {
                        _instance.TableNO = (string)value;
                        return;
                    }
                case "KindName":
                    {
                        _instance.KindName = (string)value;
                        return;
                    }
                case "FoodName":
                    {
                        _instance.FoodName = (string)value;
                        return;
                    }
                case "Price":
                    {
                        _instance.Price = (float)value;
                        return;
                    }
                case "FoodCount":
                    {
                        _instance.FoodCount = (float)value;
                        return;
                    }
                case "UserName":
                    {
                        _instance.UserName = (string)value;
                        return;
                    }
                case "CreateTime":
                    {
                        _instance.CreateTime = (DateTime)value;
                        return;
                    }
                case "Comment":
                    {
                        _instance.Comment = (string)value;
                        return;
                    }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectCreater Members

        public object CreateObject()
        {
            return new FoodOrders();
        }

        public System.Collections.IList CreateObjectList()
        {
            return new System.Collections.Generic.List<FoodOrders>();
        }

        #endregion
    }
}
